//
//  MathTools.h
//  FrameWork
//
//  Created by Eagle on 6/30/10.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>

//计算当前作标点的角度,(0, 0)为原点
float GetDegree(float x, float y);

//计算当前角度对应的区域
int GetAreaFromDegree(float degree);

//判断是否需要镜像
bool IsNeedFlipX(float degree);

//判断是顺时针旋转还是逆时针旋转
int ClockOrWiseClock(float degree1, float degree2);

//计算绝对角度差, 1 - 180
float GetAbsDegree(float degree1, float degree2);

template<class T>
NSMutableData* ReadData( NSMutableData*pData,T r_data)
{
	int size = sizeof(T);
	[pData appendBytes:&r_data length:size];
	return pData;
}

